import os
import zipfile

from selenium import webdriver

from src.downloadFile import download
from src.editFile import edit
from src.unzip import unzip
from src.process import process_bar
from src.excel import excel


def execute():
    count = download()
    print('waiting for download...')
    input('press enter after download finish')
    print('unzip start')
    # count = 63
    unzip(process_bar, count)
    print('unzip finished')
    print('starting analysis')
    excel('./saved files')
    print('finished')
    path = os.path.join(os.getcwd(), 'html_vue3/project')
    res = os.system(f'cd {path} && npm run build')
    driver = webdriver.Chrome()
    driver.get("file://" + os.path.join(os.getcwd(), './html_vue3/project/dist/index.html'))
    driver.maximize_window()
    input(res)



execute()
